<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./index.css">
  <title>Document</title>
</head>

<body>
  <button onclick="getInfo()">测试</button>
</body>
<script src="./index.js"></script>
<script>
  function getInfo () {
    fetch("/test?name=1", { method: "post", }).then((response) => {
      response.json().then((data) => {
        console.log(data)
      })
    })
  }
</script>

</html>